﻿using System;
using NUnit.Framework;

namespace Cfg.Test
{
    [TestFixture]
    public class ConnectionStringTest
    {
        [Test]
        public void GetExistingConnectionString()
        {
            var cs = ConnectionStrings.Get("test");
            Assert.AreEqual("cs", cs);
        }

        [Test]
        public void GetNotExistingConnectionString()
        {
            var cs = ConnectionStrings.Get("x");
            Assert.IsNull(cs);
        }

        [Test]
        [ExpectedException(typeof(ArgumentNullException))]
        public void GetNotExistingConnectionStringAndThrow()
        {
            ConnectionStrings.Get("x", true);
        }
    }
}